package org.example.service;

import cn.hutool.core.collection.CollUtil;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.common.utils.IPUtils;
import org.example.model.dto.FullUserDto;
import org.example.model.dto.QueryFullUserOption;
import org.example.model.dto.ResetUserPwdDto;
import org.example.model.entity.SysUser;
import org.example.model.dto.UserLoginDto;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;

/**
 * @author weigang
 * @create 2022-11-08 15:16
 */

@AllArgsConstructor
@Service
@Slf4j
public class ISysUserServiceImpl implements ISysUserService{

    @Override
    public List<FullUserDto> listFullUsers(Collection<String> itCodes, QueryFullUserOption option) {
        if (CollUtil.isEmpty(itCodes)) {
            return Collections.emptyList();
        }else {
            return Collections.emptyList();
        }
    }

    @Override
    public Set<String> getUserNamesForLoginUser(FullUserDto fullUser, boolean judgeManageRole, boolean judgeTeam) {
        return null;
    }

    @Override
    public void resetUserPwd(ResetUserPwdDto resetUserPwdParam, FullUserDto currentUser) {

    }

    @Override
    public SysUser getSysUserById(Long id) {
        return null;
    }

    @Override
    public void login(UserLoginDto loginParam, HttpServletRequest request) {
        log.info(" ************ user login : [{}] , ip address : [{}] ,  ************ " , loginParam.getItCode(), IPUtils.getIpAddr(request));
    }
}
